﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VideoStore.Services.Interfaces;
using VideoStore.Business.Components;
using VideoStore.Business.Components.Interfaces;
using Microsoft.Practices.ServiceLocation;
using System.ServiceModel;

namespace VideoStore.Services
{
    public class TransferOutcomeService : ITransferOutcomeService
    {
        private IOrderProvider OrderProvider
        {
            get { return ServiceLocator.Current.GetInstance<IOrderProvider>(); }
        }

        [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)]
        public void NotifyTransferOutcome(String message, Boolean outcome)
        {
            OrderProvider.ConfirmOrder(System.Convert.ToInt32(message),outcome);
        }
    }
}
